package org.genntii.warehousesystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.genntii.warehousesystem.domain.entity.Cart;

import java.util.List;


@Mapper
public interface CartMapper extends BaseMapper<Cart> {

    @Update("update cart set num = #{num} where id = #{id}")
    void setNum(@Param("num")int num, @Param("id")int id);

    @Select("select * from cart where user_id = #{userId}")
    List<Cart> showAll(@Param("userId")int userId);

}
